#include<bits/stdc++.h>
using namespace std;
int arr[43];
int main()
{
	int x;
	for (int i = 1; i <= 10; i++) {
		cin >> x;
		arr[x%42] = 1;
	}
	int count = 0;
	for(int i=0;i<42;i++){
		if(arr[i] == 1){
			count ++;
		}
	}
	cout << count << endl;
	return 0;
}
